# coding=utf-8


import os


DEBUG = True


BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))

# tornado配置
TORNADO_SETTING = {
    "debug": DEBUG,
    "template_path": os.path.join(BASE_DIR, "templates"),
    "static_path": os.path.join(BASE_DIR, "static"),
    "ui_modules": {},
    "xsrf_cookies": False,
    "cookie_secret": "hello world",
    "login_url": "/login",
    "autoescape": None,
    "local": "zh_CN",
    "gzip": False
}

# 登录用的token过期时间
AUTH_SETTING = {
    "token_age": 10,
}

# 数据库设置
DB_SETTING = {
    "file": os.path.join(BASE_DIR, "data", "db.sqlite")
}

# logger设置
LOGER_SETTING = {
    "name": "run",
    "level": "info",
    "max_size": 50*1024*1024,
    "max_count": 10,
    "format": "%(levelname)s %(asctime)s %(pathname)s line:%(lineno)d %(message)s",
    "file": os.path.join(BASE_DIR, "logs", "run.log"),
    "terminal": DEBUG
}

# 调用区块核心系统的api
CHAIN_ADDRESS = "http://10.10.30.59:5001"

CHAIN_API = {
    "create_wallet": CHAIN_ADDRESS + "/wallets/",
}

# admin区块相关账号
PRIVATE_KEY = "2348279789udfisofiuh2iu3hnh23omih2o3huih3"
